home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 3 / CD ACTUAL 3.iso / linux / sonido / mod-0.000 / mod-0 / mod / tables.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-15  |  4.4 KB  |  114 lines

  1. /*
  2.  *  tables.c - Contains tables used while playing module.
  3.  *
  4.  *  (C) 1994 Mikael Nordqvist (d91mn@efd.lth.se, mech@df.lth.se)
  5.  */
  6.  
  7. #include "mod.h"
  8.  
  9. /*
  10.  * The periodtable is made so that PT-modules will play as good as possible.
  11.  * That is, octaves 3-5 has periods _exactly_ 4* the values in the PT-sources.
  12.  * Octaves 2 and 6 use the values found in MODFIL10.TXT (*4).
  13.  * This is very close to the "math-wise" correct values, but not exact. The
  14.  * other notes are as exact as they can be with respect to note C-4 (1712).
  15.  *
  16.  * Octaves used:  MOD 2-6, MTM 2-D#7, ULT 2-9, S3M 0-7
  17.  */
  18.  
  19. int periodtable[NR_OCTAVES*12]={ /* Tuning 0 - Normal */
  20.  27392,25854,24403,23034,21741,20521,19369,18282,17256,16287,15373,14510, /*0*/
  21.  13696,12927,12202,11517,10871,10260, 9685, 9141, 8628, 8144, 7687, 7255, /*1*/
  22.  6848 , 6464, 6100, 5760, 5428, 5124, 4836, 4564, 4308, 4068, 3844, 3628, /*2*/
  23.  3424 , 3232, 3048, 2880, 2712, 2560, 2416, 2280, 2152, 2032, 1920, 1812, /*3*/
  24.  1712 , 1616, 1524, 1440, 1356, 1280, 1208, 1140, 1076, 1016,  960,  904, /*4*/
  25.  856  ,  808,  760,  720,  680,  640,  604,  572,  540,  508,  480,  452, /*5*/
  26.  428  ,  404,  380,  360,  340,  320,  304,  284,  268,  256,  240,  228, /*6*/
  27.  214  ,  202,  191,  180,  170,  160,  151,  143,  135,  127,  120,  113, /*7*/
  28.  107  ,  101,   95,   90,   85,   80,   76,   71,   67,   64,   60,   57, /*8*/
  29.  53   ,   50,   48,   45,   42,   40,   38,   36,   34,   32,   30,   28  /*9*/
  30. };
  31.  
  32.  
  33. /* Used for EFX_VIBRATO and EFX_TREMOLO */
  34.  
  35. short vibrato_tables[4][64]={
  36.     {   /* Sine */
  37.     0,24,49,74,97,120,141,161,
  38.     180,197,212,224,235,244,250,253,
  39.     255,253,250,244,235,224,212,197,
  40.     180,161,141,120,97,74,49,24,
  41.     0,-24,-49,-74,-97,-120,-141,-161,
  42.     -180,-197,-212,-224,-235,-244,-250,-253,
  43.     -255,-253,-250,-244,-235,-224,-212,-197,
  44.     -180,-161,-141,-120,-97,-74,-49,-24
  45.     },{ /* Ramp-down */
  46.     0,8,16,24,32,40,48,56,
  47.     64,72,80,88,96,104,112,120,
  48.     128,136,144,152,160,168,176,184,
  49.     192,200,208,216,224,232,240,248,
  50.     -255,-247,-239,-231,-223,-215,-207,-199,
  51.     -191,-183,-175,-167,-159,-151,-143,-135,
  52.     -127,-119,-111,-103,-95,-87,-79,-71,
  53.     -63,-55,-47,-39,-31,-23,-15,-7
  54.     },{ /* Square */
  55.     255,255,255,255,255,255,255,255,
  56.     255,255,255,255,255,255,255,255,
  57.     255,255,255,255,255,255,255,255,
  58.     255,255,255,255,255,255,255,255,
  59.     -255,-255,-255,-255,-255,-255,-255,-255,
  60.     -255,-255,-255,-255,-255,-255,-255,-255,
  61.     -255,-255,-255,-255,-255,-255,-255,-255,
  62.     -255,-255,-255,-255,-255,-255,-255,-255
  63.     },{ /* Some player (not PT) use this as random I think, but I'll just
  64.      * set it to sine until I know for sure.
  65.      */
  66.     0,24,49,74,97,120,141,161,
  67.     180,197,212,224,235,244,250,253,
  68.     255,253,250,244,235,224,212,197,
  69.     180,161,141,120,97,74,49,24,
  70.     0,-24,-49,-74,-97,-120,-141,-161,
  71.     -180,-197,-212,-224,-235,-244,-250,-253,
  72.     -255,-253,-250,-244,-235,-224,-212,-197,
  73.     -180,-161,-141,-120,-97,-74,-49,-24
  74.     }
  75. };
  76.  
  77. /* Note: Notes are printed differently depending on format. All formats
  78.  * except S3M use octave 2 as middle octave. S3M uses 4. No tracker has
  79.  * notes spanning over more than 8 octaves. The empty note is only used
  80.  * with S3M's.
  81.  */
  82.  
  83. char *notenames[NR_OCTAVES*12+1]={
  84.     "C-0","C#0","D-0","D#0","E-0","F-0","F#0","G-0","G#0","A-0","A#0","B-0",
  85.     "C-1","C#1","D-1","D#1","E-1","F-1","F#1","G-1","G#1","A-1","A#1","B-1",
  86.     "C-2","C#2","D-2","D#2","E-2","F-2","F#2","G-2","G#2","A-2","A#2","B-2",
  87.     "C-3","C#3","D-3","D#3","E-3","F-3","F#3","G-3","G#3","A-3","A#3","B-3",
  88.     "C-4","C#4","D-4","D#4","E-4","F-4","F#4","G-4","G#4","A-4","A#4","B-4",
  89.     "C-5","C#5","D-5","D#5","E-5","F-5","F#5","G-5","G#5","A-5","A#5","B-5",
  90.     "C-6","C#6","D-6","D#6","E-6","F-6","F#6","G-6","G#6","A-6","A#6","B-6",
  91.     "C-7","C#7","D-7","D#7","E-7","F-7","F#7","G-7","G#7","A-7","A#7","B-7",
  92.     "---"
  93. };
  94.  
  95. char *effectnames[NR_EFX]={
  96.     "Apg ","Pr U","Pr D","Pr N","Vib ","P&VS","V&VS","Trem",
  97.     "$08 ","SOff","VlS ","Jump","Vol ","Brk ","!?&!","SpdT",
  98.     "LP-F","FPrU","FPrD","Glis","V-WF","Tune","Loop","T-WF",
  99.     "$E8 ","Trig","FV U","FV D","Cut ","NDly","PDly","InvL",
  100.     "Bal ","VDpt","SOfU","EFPU","EFPD","Trmr","SOff","TgVS",
  101.     "Spd ","Tmpo","GVol","Pr U","Pr D","VlSC"
  102. };
  103.  
  104. char *shorteffectnames[NR_EFX]={
  105.     "Apg","PrU","PrD","PrN","Vib","PVS","VVS","Trm",
  106.     "$08","SOf","VlS","Jmp","Vol","Brk","!?&","SpT",
  107.     "LPF","FPU","FPD","Gls","VWF","Tun","Lop","TWF",
  108.     "$E8","Trg","FVU","FVD","Cut","NDy","PDy","IvL",
  109.     "Bal","VDt","USO","XPU","XPD","Tmr","SOf","TgV",
  110.     "Spd","Tpo","GVl","PrU","PrD","VSC"
  111. };
  112.  
  113. char effect_used[NR_EFX];
  114.